package app.negocio;

import java.util.List;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.Query;

import app.entidad.Banco;
import app.entidad.Rol;



public class RolDAO {
	@Inject
	private EntityManager em;
	
	public void insert(Rol c){
		em.persist(c);
	}
	public Rol read(String id){
		Rol m = em.find(Rol.class, id);
		return m;
	}
public List<Rol> getrol(){
		
		String sql = "SELECT c From Rol c WHERE c.rol_codigo = :rol_codigo";
		
		Query q =  em.createQuery(sql, Rol.class);
			
		List<Rol> lst = q.getResultList();
		
		return lst;
	}

}
